import Vue from 'vue'
import Router from 'vue-router'
import TabBar from '@/components/TabBar'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'TabBar',
      name_cn: '首页',
      component: TabBar,
      children: [
        {
          path: '/',
          name: 'film',
          name_cn: '正在上映',
          component: resolve => {
            require(['@/pages/Home'], resolve)
          }
        },
        {
          path: '/cinema',
          name: 'cinema',
          name_cn: '电影院',
          component: resolve => {
            require(['@/pages/Cinema'], resolve)
          }
        },
        {
          path: '/shop',
          name: 'shop',
          name_cn: '商城',
          component: resolve => {
            require(['@/pages/Shop'], resolve)
          }
        },
        {
          path: '/mine',
          name: 'mine',
          name_cn: '个人中心',
          component: resolve => {
            require(['@/pages/Mine'], resolve)
          }
        },
        {
          path: '/comingsoon',
          name: 'comingsoon',
          name_cn: '正在上映',
          component: resolve => {
            require(['@/pages/Home'], resolve)
          }
        }
      ]
    },
    {
      path: '/movie/:id',
      name: 'movie',
      name_cn: '电影详情',
      component: resolve => {
        require(['@/pages/Movie'], resolve)
      }
    }
  ]
})
